import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { MonitorVo, PageVo } from 'src/app/shared/models';

@Component({
    selector: 'monitor-table',
    templateUrl: './monitor-table.component.html',
})
export class MonitorTableComponent implements OnInit {
    @Input() monitorPage: PageVo<MonitorVo>;
    @Input() isFrontPagination = false;
    @Output() readonly updateData = new EventEmitter<PageVo<MonitorVo>>();
    constructor() { }

    ngOnInit(): void { }

    refreshData(reset = false) {
        if (reset) {
            this.monitorPage.pageIndex = 1;
        }
        this.updateData.emit(this.monitorPage);
    }
}
